import Vue from 'vue'
import App from './App'
import baseConfig from '@/config/baseUrl.js'
// 引入全局uView
import uView from '@/uni_modules/uview-ui'
// vuex
import store from './store'
Vue.prototype.$store = store
Vue.prototype.$baseConfig = baseConfig
Vue.config.productionTip = false
Vue.use(uView)
uni.$u.config.unit = 'rpx' //默认为rpx单位
// 工具集合
import {
	goToPage
} from './plugins/utils.js'
Vue.prototype.$goToPage = goToPage
//全局地址
import api from '@/api/api.js'
Vue.prototype.$api = api

// //配置公共方法
import commonJS from '@/config/common.js'
for (let func of Object.keys(commonJS)) {
	Vue.prototype[`$${func}`] = commonJS[func]
}
//解密加密
import AES from '@/plugins/ar-aes.js'
Vue.prototype.AES = AES.AES

import WebSocket from '@/config/cim/cim.uniapp.sdk.js'
Vue.prototype.$websocket = new WebSocket(baseConfig.webSocketUrl + '/websockets')
Vue.prototype.$websocket.connect()

// 全局认证服务
import authService from '@/common/libs/authService.js'
Vue.prototype.$auth = authService

App.mpType = 'app'

const app = new Vue({
	store,
	...App
})
app.$mount()